#ifndef ABSTRACTFAVORITESITEM_H
#define ABSTRACTFAVORITESITEM_H
#include <QString>

class QDataStream;
class QIcon;

namespace ExecTerminalImplNS 
{
    class FolderFavoritesItem;
    class AbstractFavoritesItem
    {
    public:
        AbstractFavoritesItem(const QString & aname, FolderFavoritesItem * prnt = 0);
        virtual ~AbstractFavoritesItem();
        QString name()const;
        void setName(const QString & aname);
        virtual bool isFolder()const = 0;
        FolderFavoritesItem * parent()const;
        void setParent(FolderFavoritesItem * futureParent, int posInParent);//updates children lists
        int numberInParent()const;
        QIcon icon()const;        

        virtual void readFromDataStream(QDataStream &) = 0;
        virtual void writeToDataStream(QDataStream &)const = 0;

    protected:
        AbstractFavoritesItem(FolderFavoritesItem * prnt = 0);
        friend QDataStream & operator>>(QDataStream &, AbstractFavoritesItem & fa);
        friend QDataStream & operator<<(QDataStream &, const AbstractFavoritesItem & fa);

    private:
        virtual QIcon provideIcon()const = 0;

    private:
        QString theName;
        FolderFavoritesItem * theParent;
    };

}

#endif
